package org.dizena.base.mq;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class MqQueue
{

    @Value("${spring.profiles.active}")
    private String env;
    @Resource
    private RedisTemplate<String, Object> redis;

    public void product(Object msg)
    {
        String topic = env + ":chat";
        redis.convertAndSend(topic, msg);
    }
}
